home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
E-Education
/
(c)ed2.d64
/
swap-vegetable
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
7KB
|
215 lines
1 GOTO910
2 PRINT"x[169][141][169][141]X` [234][255][169][255][133][145]L4[234]x[169]1[141][169][234][141]X`
3 [153]"xSTEPGINPUTSTOPSTEPINPUTONX` (null)(null)STEP(null)INPUTLISTLX(null)xSTEPUINPUTSTOPSTEP(null)INPUTONX`
4 PRINT"xhhh[170]h[168]hhhhhhh[152]H[138]HX`
5 [153]"hhhhhhh`
6 PRINT"[160][255][200][132][251][169][216][133][252] [241][183][138][162][160][255][200][145][251][136][208][251][230][252][202][208][246]`
7 [153]"NEWCLOSE(null)LEFT$>(null)ON(null)LET(null)(null)(null)(null)(null)(null)MID$(null)(null)`
35 IFUW=0THENSYSUU,15
40 POKEUC,0:POKEUN,0:UR$="":UI$="":IFUL=0THENUL=39
45 GETUI$:IFUI$=""THEN45
50 UA=ASC(UI$):UR=LEN(UR$):IFUA=13ANDUR>0THENPOKEUC,1:PRINT" [157]";:GOTO75
55 IFUA=20THENON-(UR=0)GOTO45:UR$=LEFT$(UR$,UR-1):PRINT"[157] [157][157]";:GOTO45
60 IFUR=ULTHEN45
65 GOSUB95:UR$=UR$+UI$:PRINTUI$;:GOTO45
75 FORUI=URTO1STEP-1:IFMID$(UR$,UI,1)=" "THENNEXT
80 UR$=LEFT$(UR$,UI):PRINT:RETURN
95 IFLEN(US$)=0THEN110
100 FORUI=1TOLEN(US$):IFUI$<>MID$(US$,UI,1)THENNEXT:UI$=""
105 RETURN
110 IFUA=46THENRETURN
115 IFUA=32ANDUR<>0THENRETURN
120 IFUA>47ANDUA<58THENRETURN
125 IFUA>64ANDUA<91THENRETURN
130 IFUA<193ORUA>218THENUI$="":RETURN
135 IFPEEK(UT)=UU%THENUI$=CHR$(UA-128)
140 RETURN
155 UZ=0:US$=UJ$:UG$=UK$:UT$=UL$:UP=UJ:UL=UK:PRINT"[147]";:POKEUY,6:POKEUX,6
160 POKEUT,UV%:POKE251,0:POKE252,UF:POKE253,0:POKE254,US/256:SYSUV:SYSUU,15
165 POKEU1,U1%:POKEU2,U2%:POKEU3,U3%-1:POKEU4,U4%:GOTO35
300 REM DERIVED FROM COMMODORE ONTARIO EDUCATIONAL SOFTWARE PROJECT 1989
310 REM PROJECT DIRECTOR: FRANK WINTER
320 REM PROGRAM NAME: SWAP
330 REM WRITTEN BY THE SHADOW
340 REM REVISED BY SANDRA BLANKENFELDT
350 REM UPDATED BY BILL CUMBERLAND 90
400 PRINT"[147]":POKEUT,UL%:POKEUY,5:POKEUX,5:POKE646,0
405 PRINT" [201][206][211][212][210][213][195][212][201][207][206][211] [146]"
410 PRINT" [212]HIS IS A GAME OF [211][215][193][208]. [201] WILL GIVE"
420 PRINT" YOU A LIST OF WORDS. [217]OU PUT THEM"
425 PRINT" IN ALPHABETICAL ORDER, TOP TO BOTTOM."
430 PRINT" [175][175][175][175][175][175][175][175][175][175][175][175][175][175][175] [175][175][175][175][175][175][175][175][175][175][175][175][175]"
435 PRINT" [201]F [201] GIVE YOU [146] [208]UT THEM IN [146]"
440 PRINT" THESE WORDS [146] THIS ORDER [146]"
445 PRINT" [208][207][212][193][212][207] [193][208][208][204][197]"
450 PRINT" [207][210][193][206][199][197] [195][200][197][210][210][217]"
455 PRINT" [195][200][197][210][210][217] [207][210][193][206][199][197]"
460 PRINT" [193][208][208][208][204][197] [208][207][212][193][212][207]"
465 GOSUB820
470 PRINT"[147] [215]HEN IT IS YOUR TURN, YOU MAY TELL ME"
475 PRINT" TO SWAP ANY TWO WORDS IN THE LIST. [201]"
480 PRINT" WILL THEN SWAP THOSE TWO WORDS AND"
485 PRINT" GIVE YOU ANOTHER TURN UNTIL THE LIST"
490 PRINT" IS IN ALPHABETICAL ORDER.
495 [141]820:[142]
700 [143] <YES>
705 S[178]54272:[129]E[178]S[164]S[170]28:[151]E,0:[130]
710 [151]54296,15:[151]54277,42:[151]54278,250
715 [151]54276,23:[151]54273,23:[151]54272,191
720 [129]T[178]1[164]150:[130]:[151]54276,23:[129]T[178]1[164]200:[130]
725 [151]54296,0:[142]
760 [143] <YES>
765 S[178]54272:[129]E[178]S[164]S[170]28:[151]E,0:[130]
770 [151]54296,15:[151]54277,42:[151]54278,250
775 [151]54276,23:[151]54273,23:[151]54272,191
780 [129]T[178]1[164]30:[130]:[151]54276,23:[129]T[178]1[164]50:[130]
785 [151]54296,0:[142]
790 [129]T[178]1[164]500:[130]:[142]
791 [129]T[178]1[164]1000:[130]:[142]
792 [129]T[178]1[164]2000:[130]:[142]
793 [129]T[178]1[164]3000:[130]:[142]
794 [129]T[178]1[164]4000:[130]:[142]
800 [153]"LOAD";:[151]UT,UU%:[151]UY,1:[151]UX,1:[151]646,5
801 [153]" A TPUG EDUCATIONAL PROGRAM
802 PRINT" FOR C 64 COMPUTER
803 [153]" GRADES 3-6
804 GOSUB791
805 PRINT" [146]";
806 PRINT" [146]";
807 PRINT" SWAP-VEGETABLE [146]";
808 PRINT" [146]";
809 PRINT" [146]"
810 GOSUB791:GOSUB760
811 PRINT" INSTRUCTIONS? Y/N.
812 [161]UI$:[139]UI$[179][177]"Y"[175]UI$[179][177]"N"[167]812
813 [139]UI$[178]"Y"[167][141]400
814 [137]1000
820 [141]791:[141]760
823 [151]UN,0:[153][200](UD$,24);" (null)RESS (null)(null)ATNLENVAL PEEKATN(null) TO CONTINUE WAIT"
825 [161]UI$:[139]UI$[179][177]" "[167]825
830 [142]
835 [141]791:[141]760
837 [151]UN,0:[153][200](UD$,24);" PRESS SPACE BAR TO CONTINUE WAIT"
840 [161]UI$:[139]UI$[179][177]" "[167]840
845 [142]
850 UP[178]UP[170]1:[153]"LOAD"[200](UT$[170]UP$,21);[201](UP$[170]UG$[170][196](UP),18)
855 [153]" --------------------------------------"
860 [139]UH[178]0[167][153][200](UD$,24);[200](UP$,6);"ATNNSWER, THEN PRESS (null)VAL(null)(null)(null)(null)WAIT
865 UH=0:PRINT"":RETURN
875 PRINTLEFT$(UD$,24);" ONE MOMENT PLEASE... ":RETURN
880 GOSUB792:GOSUB760
900 US=1024:U1=209:U2=210:U3=211:U4=214:UC=204:UB=2048:UX=53280:UD=2064
902 UT=53272:UU%=21:UL%=23:UP%=2151:UN=198:UY=53281:UU=2199:UE=2087
904 UC$=CHR$(155):UV=1214:UF=196:UV=2238
905 UD$="":UP$=" "
909 RETURN
910 GOSUB900:PRINT"[147] "
920 GOTO800
1000 PRINT"[147]"UC$;:RESTORE:POKEUY,0:POKEUX,0
1005 UP=0
1010 :UG$=""
1205 IF BARRY=0THENDIMA(255):BARRY=1
1210 GOTO 1320
1225 REM GOTO 1445
1230 PRINT" [200]ERE ARE[157][157][157][157][157][157][157][157]YOUR WORDS."
1231 REM PRINT"[200]ERE ARE YOUR WORDS."
1235 GOSUB1515
1240 PRINT""
1245 PRINT:PRINT" [215]HICH WORDS[157][157][157][157][157][157][157][157][157][157][157]SHALL [201] SWAP?":PRINT
1250 PRINT" [198][201][210][211][212][160][215][207][210][196]? [157][157][157][157][157][157][157][157]";:US$="":UL=15:UH=0:GOSUB35:C$(1)=UR$
1251 PRINT" [211][197][195][207][206][196][160][215][207][210][196]? [157][157][157][157][157][157][157][157]";:US$="":UL=15:UH=0:GOSUB35:C$(2)=UR$
1255 UH=0:FORF=1TOR:IFC$(1)=W$(F)THEN1265
1260 NEXTF:PRINT" [195]HECK YOUR SPELLING.":GOTO1240
1265 UH=0:FORF=1TOR:IFC$(2)=W$(F)THEN1275
1270 NEXTF:PRINT" [195]HECK YOUR SPELLING.":GOTO1240
1274 REM PRINT"[147]":GOSUB1515
1275 PRINT"[147]":GOSUB1515
1280 FORX1=1TO2
1285 FORX=1TOR
1290 IFC$(X1)=W$(X)THEND(X1)=X
1295 NEXTX:NEXTX1
1300 IFD(1)<D(2)THEN1310
1305 C$=C$(1):D(3)=D(1):C$(1)=C$(2):D(1)=D(2):C$(2)=C$:D(2)=D(3)
1310 GOSUB1525
1315 GOTO1665
1320 REM***INSTRUCTIONS
1325 POKEUT,UL%
1330 REM
1406 PRINT"[147] [212]YPE YOUR NAME AND PRESS [210][197][212][213][210][206][146][145][157][157][157][157][157][157][164][164][164][164][164][164]."
1410 PRINT" ";:US$="":UL=15:GOSUB35:GOSUB865:J$=UR$
1415 IFASC(J$)<90THENJ1$=CHR$(ASC(J$)+128):J$=J1$+MID$(J$,2)
1420 PRINT"[147] [200]ELLO, "J$
1425 PRINT" [217]OU MAY HAVE FROM 3 TO 8 WORDS.":GOSUB760
1430 PRINT" [200]OW MANY WORDS DO YOU WANT ? ";:US$="2345678"
1434 GOSUB35:PRINT"[147]"
1435 R=VAL(UR$)
1445 REM SELECTING WORDS
1450 WD=29:REM WD=NUMBER OF DATA WORDS
1455 FOR X = 1 TO R
1460 Y =INT(RND(TI)*WD)+1 : IF Y>WD THEN 1460
1465 FOR Z = 1 TO Y: READ N$: NEXT Z: W$(X)=N$: RESTORE:IFA(Y)=1THEN1460
1470 A(Y)=1
1475 NEXT X
1480 Z=0:FORQ=1TOR-1:IFW$(Q)<W$(Q+1)THENZ=Z+1
1485 NEXTQ:IFZ=R-1THEN1445
1490 GOTO1230:REM WD=29 - NUMBER OF DATA WORDS
1495 DATA"APPLE","CHERRY","GRAPE","TREE","VINE","TWIG","PEACH","ACORN","GRASS"
1500 DATA"WEED","ELM","OAK","MAPLE","POPLAR","ASPEN","WILLOW","WHEAT","OATS"
1505 DATA"BARLEY","RICE","CACTUS"
1510 DATA"FERN","ORCHID","LILY","CORN","GRAPEFRUIT","LIME","ROSE","HICKORY"
1515 UH=0:FORX=1TOR:PRINTTAB(16)W$(X):PRINT:NEXTX:PRINT"":RETURN
1520 REEMPRINT"[145][145][145][145][145][145]":UH=1:FORQ=1TO6:PRINT" ":NEXTQ
1525 REM"[166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166]SWAP WORDS
1526 [151]59467,16:[151]59466,200
1530 [143]"SPC(SPC(SPC(SPC(SPC(SPC(SPC(SPC(SPC(SPC(SPC(SPC(MOVE WORD SIDEWAYS
1535 FOR X=1TO10
1540 FORY=1TOD(1):PRINT"":A=INT(RND(1)*255)+1:POKE59464,A:NEXTY
1545 PRINTTAB(15+X)" "C$(1)""
1550 FORY=1TOD(2):PRINT"":A=INT(RND(1)*255)+1:POKE59464,A:NEXTY
1555 PRINTTAB(16-X)C$(2)" "
1560 NEXT X
1565 PRINT""
1570 REM"[166][166][166][166][166][166][166][166][166][166][166]MOVE WORD UP & DOWN
1575 E1[178]D(1):E2[178]D(2)
1580 [129]X[178]1[164]([182](D(1)[171]D(2)))
1585 [129]Y[178]1[164]E1:[153]"":A[178][181]([187](1)[172]255)[170]1:[151]59464,A:[130]Y
1590 [153][163]26)" CMDCMDCMDCMDCMDCMDCMDCMDCMDCMD"C$(1)"":E1[178]E1[170]1
1595 [129]Y[178]1[164]E2:[153]"":A[178][181]([187](1)[172]255)[170]1:[151]59464,A:[130]Y
1600 [153][163]6)" ONONCMDCMDCMDCMDCMDCMDCMDCMDCMDCMD"C$(2)"":E2[178]E2[171]1
1605 [130]X
1610 [143] MV WD BACK SIDWAYS
1615 [129]X[178]1[164]10
1620 [129]Y[178]1[164]D(1):[153]"":A[178][181]([187](1)[172]255)[170]1:[151]59464,A:[130]Y
1625 [153][163]5[170]X)" ";C$(2)""
1630 [129]Y[178]1[164]D(2):[153]"":A[178][181]([187](1)[172]255)[170]1:[151]59464,A:[130]Y
1635 [153][163]26[171]X)C$(1)" "
1640 [130]X:[143] PRINT""
1645 V$[178]W$(D(1)): W$(D(1))[178]W$(D(2)) :W$(D(2))[178]V$
1650 D[178]D(1):D(1)[178]D(2):D(2)[178]D
1655 [151]59467,0:[151]59466,0:[151]59464,0:[142]
1660 [129]X[178]1[164]R:[153]W$(X)" ";:[130]X:[153]" ":[142]
1665 [143]***CHECK FOR CORRECT LISTING
1670 [129]T[178]1[164]R[171]1
1675 [139]W$(T)[179] W$(T[170]1)[167][130]T:[137]1685
1680 [137]1240
1685 [151]59467,16:UH[178]1:[153]"LOAD (null)OU CHR$OT RIGHT$T, "J$".":[141]700
1686 [151]59466,85:[151]59464,0:[129]I[178]1[164]20:
1687 [153]" (null)OU CHR$OT RIGHT$T, "J$".":[129]DL[178]1[164]5:[130]
1688 [153]" (null)OU CHR$OT RIGHT$T, "J$".":[129]DL[178]1[164]5:[130]
1689 [151]59464,[181]([187](1)[172]255):[130]
1690 [141]700:[141]792:[141]760:[137] 1810
1810 [153]"LOAD (null)OULD YOU LIKE TO PLAY AGAIN?":[141]760
1820 [153]" (null) OR (null) ";
1830 [161]R$:[139]R$[179][177]"Y"[175]R$[179][177]"N"[167]1830
1840 [139]R$[178]"N"[167] 1910
1850 R[178]R[170]1:[153]" "
1860 [153]" (null)HANKS, "J$ :[141]700:[141]790
1870 [153]" (null)OU HAD"R[171]1"WORDS.":[141]760:[141]792
1880 [153]" (null)OW, TRY"R"WORDS.":[141]760:[141]793
1890 [140]:[137]1420
1920 [153]"LOAD (null)ETURNING TO THE (null)VAL(null)(null)
1930 RUN
1940 END
2000 REM WHC 90:11:27
2035 PRINT" [217] OR [206] ";